<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>组件参数校验与非Props特性</title>
		<script src="js/vue.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
		<div id="app">
			<child></child>
			<child content="hello world"></child>
			<child content="hello"></child>
		</div>
		<script type="text/javascript">
		Vue.component('child',{
			props:{
				/* 定义参数类型 */
				/* content:[Number,String] */
				 content:{
					 type:String,
					 //required: false,
					 //default:'default value'
					 validator:function(value){
						 return (value.length > 5)
					 }
					 }
			},
			template:"<div>{{content}}</div>"
		})
			var vm = new Vue({
				el:'#app',
			});
		</script>
	</body>
</html>
